﻿namespace DemoApp_MRU_Metro
{
    using MRULib.MRU.ViewModels;
    using System.Windows;

    /// <summary>
    /// Class manages the viewmodel objects for the application.
    /// </summary>
    public class AppViewModel
    {
        private MRUListViewModel mMruList = null;

        /// <summary>
        /// Class construtor
        /// </summary>
        public AppViewModel()
        {
            mMruList = new MRUListViewModel()
            {
                // Invoke this callback method when a file link is clicked
                LoadFileCommandDelegate = LoadFile
            };
        }

        /// <summary>
        /// Gets an MRU List property to manage a list of recently used files.
        /// </summary>
        public MRUListViewModel MruList
        {
            get
            {
                return mMruList;
            }
        }

        /// <summary>
        /// Is invoked when a file click or Load File is invoked from the MRU control.
        /// </summary>
        /// <param name="filePathName"></param>
        public void LoadFile(string filePathName)
        {
            MessageBox.Show("Demo Opening File: " + filePathName);
        }
    }
}
